package com.hobson.design.factory.simple;

import java.util.Objects;

/**
 * 数据解析器工厂
 *
 * @author: haibin.tang
 * @date: 2020/7/28
 */
public class DataParserFactory {

    public static DataParser getParser(String type) {
        if (Objects.equals(type, "xml")) {
            return new XmlDataParser();
        }
        if (Objects.equals(type, "json")) {
            return new JsonDataParser();
        }
        return null;
    }
}
